#include <iostream>
#include <ctemplate/template.h>

using namespace std;
using namespace ctemplate;

int main()
{

    //形成数据字典
    ctemplate::TemplateDictionary dic("test");
    dic.SetValue("key", "hello world! ");

    //获取被渲染网页对象：通过路径先找到旧网页
    Template *tpl = Template::GetTemplate("./index.html", DO_NOT_STRIP);

    //添加字典数据到网页中：获取渲染后的新网页
    string new_html;
    tpl->Expand(&new_html, &dic);

    cout << new_html << endl;

    return 0;
}

